4 // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
6 // The use and distribution terms for this software are contained in the file
7 // named license.txt, which can be found in the root of this distribution.
8 // By using this software in any fashion, you are agreeing to be bound by the
9 // terms of this license.
11 // You must not remove this notice, or any other, from this software.
16 namespace Microsoft
.JScript
{
19 using System
.Reflection
;
20 using System
.Reflection
.Emit
;
22 internal sealed class VoidOp
: UnaryOp
{
24 internal VoidOp(Context context
, AST operand
)
25 : base(context
, operand
) {
28 internal override Object
Evaluate(){
29 this.operand
.Evaluate();
33 internal override IReflect
InferType(JSField inference_target
){
37 internal override AST
PartiallyEvaluate(){
38 return new ConstantWrapper(null, this.context
);
41 internal override void TranslateToIL(ILGenerator il
, Type rtype
){
42 this.operand
.TranslateToIL(il
, Typeob
.Object
); //force evaluation
43 if (rtype
!= Typeob
.Void
){
44 il
.Emit(OpCodes
.Ldsfld
, CompilerGlobals
.undefinedField
);
45 Convert
.Emit(this, il
, Typeob
.Object
, rtype
);